package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteNoteEsService;
import cn.wolfcode.wolf2w.business.api.domain.NoteEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteNoteEsFallbackFactory implements FallbackFactory<RemoteNoteEsService> {
    @Override
    public RemoteNoteEsService create(Throwable cause) {
        return new RemoteNoteEsService() {
            @Override
            public R<?> initNoteEs(NoteEs noteEs, String source) {
                return R.fail("初始化攻略Es数据失败:" + cause.getMessage());
            }

        };
    }
}
